var onvif = require('onvif');
onvif.Discovery.probe(function(err, cams) {
// function will be called only after timeout (5 sec by default)
    if (err) { throw err; }
	cams.forEach(function(cam) {
        console.log(JSON.stringify(cam));
        cam.username = 'admin';
        cam.password = 'dsq120714';
        console.log('connect cam');
        cam.connect(function(response){
            console.log("response:",response);
        });    
	});
});